package com.example.boot.quartz.task;

import com.example.common.enums.KeyEnum;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * 定时任务：清空昨日uv数据
 *
 * @author ding
 * @since 2024/7/21
 */
public class UVCount extends QuartzJobBean {

    @Autowired
    private RedisTemplate redisTemplate;

    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        //从redis中删除该数据
        redisTemplate.delete(KeyEnum.UV);
    }
}
